using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace LogAnalyzerIIS.Exporters
{
	public partial class NewObjectForm : Form
	{
		public NewObjectForm(string objectName, int maxLength)
		{
			InitializeComponent();

			this.Text += objectName;
			lblDescription.Text += objectName.ToLower();

			txtName.MaxLength = maxLength;
			txtName.Focus();
		}

		public string ObjectName
		{
			get { return txtName.Text; }
			set { txtName.Text = value; }
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.Cancel;

			this.Close();
		}

		private void btnOK_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.OK;

			this.Close();
		}

		private void NewObjectForm_Shown(object sender, EventArgs e)
		{
			cbType.SelectedIndex = 0;
		}
	}
}